# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=sndio
pkgver=1.9.0
pkgrel=0
pkgdesc="Small audio and MIDI framework part of the OpenBSD project"
url="https://sndio.org/"
arch="all"
license="ISC"
makedepends="alsa-lib-dev"
subpackages="$pkgname-dev $pkgname-doc $pkgname-libs $pkgname-openrc"
install="$pkgname.pre-install"
source="https://sndio.org/sndio-$pkgver.tar.gz
	sndiod.initd
	"

build() {
	./configure --prefix=/usr
	make
}

package() {
	make DESTDIR="$pkgdir" install
	mkdir -p "$pkgdir"/usr/sbin
	mv "$pkgdir"/usr/bin/sndiod "$pkgdir"/usr/sbin/
	install -D -m 644 contrib/default.sndiod \
		"$pkgdir"/etc/conf.d/sndiod
	install -m755 -D "$srcdir"/${pkgname}d.initd \
		"$pkgdir"/etc/init.d/${pkgname}d

}

sha512sums="
f322886e428a4b5bf6867f9faaeaea26d377babbf4176960a0287ebcb0b678bf3cbac134c6c08838c9bd2094a68286be2f2df71ca0f55b7b0e816fdea9cd41cf  sndio-1.9.0.tar.gz
888534ff6076e7e216c158fb4a7f430e5d519f2a1a96072d5b4017ece5db8cf135a0183023f5a621549f4db249808e6d6b033abec90de6dcbe5ad5c0273fd1c3  sndiod.initd
"
